<div id="preferences">
<table>
<?php
// This page receives an instance of Preferences class
foreach($preferences->getAllPreferences() as $key=>$pref)
{
	echo "<tr>";
	echo 	"<td>".$preferences->getDescription($key)."</td>";
	
	switch($preferences->getFormType($key))
	{
		case 'text':
			$pref_out = "<input name=\"$key\" onchange=\"preferences_save_item(this)\""
					   ." type=\"text\" value=\"$pref\">";
		break;
		case 'boolean':
			if($pref) $check = " checked"; else $check="";
			$pref_out = "<input name=\"$key\" onclick=\"preferences_save_item(this)\""
					   ." type=\"checkbox\"$check />";
		break;
		default: $pref_out = ""; break;
	}
	
	echo 	"<td>".$pref_out."</td>";
	echo "</tr>";
}
?>
</table>
</div>

